# coding: utf-8
'''
Created on 25 avr. 2011

@author: shin
'''

from stub.DaoElement            import DaoElement
from business.Personnage        import Personnage
from business.Element           import Element
from business.ElementDeplacable import ElementDeplacable

class ElementFactory:
    '''
    static ElementFactory
    '''

    def __init__(self):
        '''
        Constructor
        '''
        pass
        
    @staticmethod
    def build(type, race):
        '''
        permet d'instancier les éléments
        '''
        daoElement = DaoElement(type, race)
        if (daoElement.objet == "Personnage"):
            return Personnage(daoElement)
        
        if (daoElement.objet == "ElementDeplacable"):
            return ElementDeplacable(daoElement)
        
        if (daoElement.objet == "Element"):
            return Element(daoElement)

